meson: Fix error when epoxy is a subproject on Windows
authorXavier Claessens <xavier.claessens@collabora.com>
Wed, 14 Oct 2020 21:26:23 +0000 (17:26 -0400)
committerXavier Claessens <xavier.claessens@collabora.com>
Thu, 15 Oct 2020 12:01:16 +0000 (08:01 -0400)
epoxy_dep cannot be used in a configure time check when it comes from a
subproject. Use variables set in pc file instead.

This requires https://github.com/anholt/libepoxy/pull/231.

meson.build

index ce6b962f4c8b383168be3d0ee1e39669a92b9e3b..0bed7b02fa02bcffbf4eb6d9ff15049afb4dcb32 100644 (file)
@@ -613,20 +613,10 @@ if win32_enabled
   backend_immodules += ['ime']
 
   # Check whether libepoxy is built with EGL support on Windows
-  win32_has_egl = cc.links(
-     '''
-     #include <epoxy/egl.h>
-        
-     int main(int argc, char *argv[])
-     {
-       EGLDisplay disp = EGL_NO_DISPLAY;
-
-       return epoxy_egl_version (disp);
-     } 
-     ''',
-     dependencies : epoxy_dep,
-     name : 'libepoxy supports EGL on Windows'
-    )
+  win32_has_egl = epoxy_dep.get_variable(
+    pkgconfig: 'epoxy_has_egl',
+    internal: 'epoxy_has_egl',
+    default_value: '0') == '1'
 endif
 
 # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by